#ifndef __CN_USART_X_H__
#define __CN_USART_X_H__
#include <string.h>
#include "wm_include.h"
typedef struct cn_uart_options
{
    u32 baudrate;    /**< Set baud rate of the UART */

    TLS_UART_CHSIZE_T charlength;   /**< Number of bits to transmit as a character (5 to 8). */

    TLS_UART_PMODE_T paritytype;    /**< Parity type */

    TLS_UART_FLOW_CTRL_MODE_T flow_ctrl;    /**< Flow control type */

    TLS_UART_STOPBITS_T stopbits;    /**< Number of stop bits */

    int  recv_overtime;

} cn_uart_options_t;

int set_usart1_config(cn_uart_options_t  *ops);
int set_usart2_config(cn_uart_options_t  *ops);
int set_usart3_config(cn_uart_options_t  *ops);
int set_usart4_config(cn_uart_options_t  *ops);
int set_usart1_colse(void);
int set_usart2_colse(void);
int set_usart3_colse(void);
int set_usart4_colse(void);
int set_all_usart_config(cn_uart_options_t  *ops);
int cn_uart_write(u8 type, char *buf, u16 lenth);
#endif

